package day13;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * @author joker
 * @date 2022/4/23 0023 - 11:22
 */
public class Test02 {
    public static void main(String[] args) throws Exception {
        Class<Person> personClass = Person.class;
        Method[] declaredMethods = personClass.getMethods();
        Field[] fields = personClass.getDeclaredFields();
        for (Method declaredMethod : declaredMethods) {
            System.out.println(declaredMethod.getName());
        }
        for (Field field : fields) {
            System.out.println(field);
        }
        Method m2 = personClass.getDeclaredMethod("m2", String.class);
        m2.setAccessible(true);
        int modifiers = m2.getModifiers();

        System.out.println(modifiers);

    }
}
